/*
============================================================================
 Name        : GetImei.h
 Author      : wwk
 Version     :
 Copyright   : Your copyright notice
 Description :  
============================================================================
*/

#if !defined(GetIMEI_H)
#define GetIMEI_H
#include <e32std.h>
#include <e32base.h>

#if defined(EKA2)
	#include <Etel3rdParty.h>
#endif

class CGetIMEI : public CActive
{
public:
	static CGetIMEI* NewL();
	virtual ~CGetIMEI();
public: // New functions
	void StartL();
	const TPtrC GetIMEI();
	const TPtrC GetModel();
	TInt GetState();
	enum TGetIMEIState
	{
		EStart = 1,
	    EGetPhoneInfo,
		EGetPhoneInfoErr,
		EDone
	};
private: 
	CGetIMEI();	
	void ConstructL();
	void RunL();
	void DoCancel();
private:
	TInt    iState;
#if defined(EKA2)
	CTelephony* iTelephony;
	CTelephony::TPhoneIdV1 iPhoneId;
	CActiveSchedulerWait iActiveSchedulerWait;
	TBuf<CTelephony::KPhoneSerialNumberSize> iIMEI;
	TBuf< CTelephony::KPhoneModelIdSize + CTelephony::KPhoneManufacturerIdSize > iModel;
#else
	TBuf<128> iIMEI;
	TBuf<128> iModel;
#endif
};
#endif//GetIMEI_H
